<?php
try{
    echo '早上起床<br/>';
    throw new Exception('拉肚子', 10);
    echo '先吃早点<br/>';
    echo '开始上班<br/>';
}catch(Exception $e){
    echo $e->getMessage();
    echo $e->getCode();
}

class Person{
    public function test() {
        try {
            // 连接数据库
        }catch (Exception $ee) {
            exit($ee->getMessage());
        }
    }
}

